/**
 * pharma-model - 9 janv. 2011 guillaume
 */
package org.bspv.pharma.model;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * @author guillaume
 */
@Entity
@Table(name = "CONSUMPTION")
public class Consumption extends Event {

    /**
     * serialVersionUID.
     */
    private static final long serialVersionUID = -4912548677264178224L;

    /**
     * @author guillaume Enumération correspondant au type de consommation.
     */
    public static enum ConsumptionTypeEnum {
        /**
         * Type de consommation normal. (utilisation)
         */
        NORMAL,
        /**
         * Type de consommation correspondant à une péremption.
         */
        PERIME,
        /**
         * Type de consommation correspondant à une perte.
         */
        PERDU,
        /**
         * Type de consommation inconnu.
         */
        INCONNU;
    }

    /**
     * Type de consommation.
     */
    @NotNull
    @Enumerated(EnumType.STRING)
    private ConsumptionTypeEnum consumptionType;

    /**
     * @return the consumptionType
     */
    public final ConsumptionTypeEnum getConsumptionType() {
        return consumptionType;
    }

    /**
     * @param consumptionType
     *            the consumptionType to set
     */
    public final void setConsumptionType(final ConsumptionTypeEnum consumptionType) {
        this.consumptionType = consumptionType;
    }
    
    /**
     * @return the eventType
     */
    public EventTypeEnum getEventType() {
        return EventTypeEnum.CONSUMPTION;
    }

}
